package gui.toolbar;

import gui.MainWindow;
import gui.menubar.OpenFileMenuItem;
import gui.menubar.SaveMapMenuItem;
import gui.view.State;
import gui.view.standard.ViewTriggers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Savepoint;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;

import com.nightpiter.controller.log.Logger;
import com.nightpiter.model.objects.Line;

import model.MetroModel;
import model.ModelChangeListener;
import model.objects.EdiLine;

public class EditorToolBar extends JToolBar{
	public EditorToolBar(MainWindow parent) {
		this.add(new FileToolBar(parent));
		this.add(new StateToolBar(parent));
		this.add(new SelectionToolBar());
		this.add(new ShowNameButton());
		this.add(new LineToolBar(parent));
	}
	class ShowNameButton extends JToggleButton {
		public ShowNameButton() {
			super("Show name");
			this.setSelected(true);
			addActionListener(new ActionListener() {

				@Override
				public void actionPerformed(ActionEvent arg0) {
					ViewTriggers.showStationsLabels = ShowNameButton.this.isSelected();	
					MetroModel.getInstance().modelChanged(false); //need to repaint views
				}
				
			});
		}
	}
}